<template>
  <div class="my-box">
    <header>
      <div class="imgBox">
        <img src="../../assets/images/nav1.png" alt="" />
        <span>×</span>
      </div>
      <div class="loginBox">
        <b @click="isLogin">{{ token ? "退出" : "立即登录" }}</b>
        <p>
          积分:
          <span>0</span>
        </p>
      </div>
    </header>
    <div class="myOrder">
      <div class="wodedingdan">
        <span>
          <i class="iconfont icon-wodedingdan"></i>
          我的订单
        </span>
        <span>></span>
      </div>
      <div class="boxs">
        <p>
          <span><i class="iconfont icon-daifukuan"></i></span>
          <span>待付款</span>
        </p>
        <p>
          <span><i class="iconfont icon-daishouhuo"></i></span>
          <span>待发货</span>
        </p>
        <p>
          <span><i class="iconfont icon-daishouhuo"></i></span>
          <span>待收货</span>
        </p>
        <p>
          <span><i class="iconfont icon-wodedingdan"></i></span>
          <span>待评价</span>
        </p>
      </div>
    </div>
    <div class="mySundry">
      <p>
        <span><i class="iconfont icon-yue"></i></span>
        <span>我的余额</span>
      </p>
      <p>
        <span><i class="iconfont icon-kanjia"></i></span>
        <span>我的砍价</span>
      </p>
      <p>
        <span><i class="iconfont icon-youhuiquan"></i></span>
        <span>我的优惠券</span>
      </p>
      <p>
        <span><i class="iconfont icon-shoucang"></i></span>
        <span>我的收藏</span>
      </p>
      <p>
        <span><i class="iconfont icon-dizhi"></i></span>
        <span>我的地址</span>
      </p>
      <p>
        <span><i class="iconfont icon-kefu"></i></span>
        <span>联系客服</span>
      </p>
    </div>
  </div>
</template>

<script>
  import "@/assets/myIconfont/iconfont.css"
  export default {
    data() {
      return {
        token: localStorage.getItem("token"),
      }
    },
    methods: {
      isLogin() {
        if (this.token) {
          localStorage.removeItem("token")
          this.token = ""
        } else {
          this.$router.push("/login")
        }
      },
    },
  }
</script>
<style lang="scss" scoped>
  .my-box {
    width: 100%;
    height: calc(100% - 1.3rem);
    overflow: hidden;
    font-size: 0.4rem;
    header {
      width: 100%;
      height: 4rem;
      padding: 0 0.2rem;
      background-color: rgb(197, 155, 76);
      display: flex;
      align-items: center;
      div {
        width: 30%;
        height: 50%;
        // background-color: red;
      }
      .imgBox {
        position: relative;
        margin-right: 0.2rem;
        img {
          width: 100%;
          height: 100%;
          border-radius: 50%;
        }
        span {
          width: 0.4rem;
          height: 0.4rem;
          text-align: center;
          line-height: 0.4rem;
          position: absolute;
          top: 0;
          right: 0;
          border-radius: 50%;
          background-color: #ebe8e89f;
        }
      }
      .loginBox {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-around;
        align-items: center;
        color: #ffffff;
        b {
          font-weight: 600;
        }
        p {
          padding: 0.2rem 0.5rem;
          font-size: 0.2rem;
          background-color: rgba(253, 159, 76, 0.822);
          border-radius: 10px;
        }
      }
    }
    .myOrder {
      width: 100%;
      display: flex;
      flex-direction: column;
      .wodedingdan {
        width: 100%;
        height: 0.8rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 0.2rem;
        font-size: 0.35rem;
        i {
          font-size: 0.5rem;
        }
      }
      .boxs {
        width: 100%;
        margin-top: 0.3rem;
        display: flex;
        p {
          width: 25%;
          height: 1.3rem;
          display: flex;
          flex-direction: column;
          justify-content: space-around;
          align-items: center;
          text-align: center;
          font-size: 0.3rem;
          i {
            font-size: 0.6rem;
          }
        }
      }
    }
    .mySundry {
      width: 100%;
      margin-top: 1rem;
      display: flex;
      flex-wrap: wrap;
      p {
        width: 33%;
        height: 1.3rem;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        align-items: center;
        text-align: center;
        font-size: 0.3rem;
        i {
          font-size: 0.6rem;
          color: orangered;
        }
      }
    }
  }
</style>
